﻿using AppService.IService.System_operation;
using Domain.Entity.System_operation;
using Domain.Entity.System_Ordermanagement;
using Domain.IRepository.System_operation;
using Domain.IRepository.System_Order;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;

namespace AppService.Service.System_operation
{
    [Dependency(ServiceLifetime.Scoped)]
    public class Bill_olService : IBill_olService
    {
        private readonly IBill_olRepository bill_olRepository;

        public Bill_olService(IBill_olRepository BillRepository)
        {
            this.bill_olRepository = BillRepository;
        }

        public List<Bill_ol> Bill_condition(string? Origin_place, string? Det_place, string? Pickup_endtime, int currentPage, int PageSize)
        {
            return bill_olRepository.Bill_condition(Origin_place,Det_place, Pickup_endtime, currentPage,PageSize);
        }

        public int Count()
        {
            return bill_olRepository.Count();
        }

        public bool DelBill(int id)
        {
            return bill_olRepository.DelBill(id);
        }

        public List<Bill_ol> GetBill_ols(int currentPage, int PageSize)
        {
            return bill_olRepository.GetBill_ols(currentPage, PageSize).Skip((currentPage - 1) * PageSize).Take(PageSize).ToList();
        }

        public List<Bill_ol> GetBill_XQ(int Billol_Id)
        {
            return bill_olRepository.GetBill_XQ(Billol_Id);
        }

        public List<Orders> GetBill_Order(string Order_Id)
        {
            return bill_olRepository.GetBill_Order(Order_Id);
        }

        public bool THZT(string Ord_Id)
        {
            return bill_olRepository.THZT(Ord_Id) >0;
        }
    }
}
